def get_tool_number():
    import time
    import urllib.request
    import re
    lp_list = ['LP11', 'LP12', 'LP13', 'LP14', 'LP15', 'LP16',
               'LP21', 'LP22', 'LP23', 'LP24', 'LP25', 'LP26',
               'LP31', 'LP32', 'LP33']
    lp_dict = {}
    for lp in lp_list:
        url = "https://als.bmwbrill.cn/Allgemein/Anlagenabbild.jsp?System=LP&Gruppe=" + lp + "&time=" + str(
            time.time())
        req = urllib.request.urlopen(url)
        content = req.read()
        req.close()
        content = content.decode('utf-8')
        tr_list = re.findall("<tr[^>]*>(.*?)</tr>", content, flags=re.S)
        row = tr_list[0]
        col_list = re.findall("<th[^>]*>(.*?)</th>", row, flags=re.S)
        lp_num = col_list[0]
        row = tr_list[3]
        col_list = re.findall("<th[^>]*>(.*?)</th>", row, flags=re.S)
        tool_num = col_list[0]
        lp_dict[lp_num] = tool_num
    print(lp_dict)
    # return lp_dict_list


get_tool_number()
